package cn.iocoder.yudao.module.system.dal.mysql.patentapplication;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.patentapplication.vo.PatentApplicationNewRespVO;
import cn.iocoder.yudao.module.system.controller.admin.patentapplication.vo.PatentApplicationPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.alluser.AllUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.patentapplication.PatentApplicationDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 会员专利申请 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PatentApplicationMapper extends BaseMapperX<PatentApplicationDO> {

    default PageResult<PatentApplicationDO> selectPage(PatentApplicationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PatentApplicationDO>()
                .betweenIfPresent(PatentApplicationDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(PatentApplicationDO::getCaseId, reqVO.getCaseId())
                .eqIfPresent(PatentApplicationDO::getUserId, reqVO.getUserId())
                .eqIfPresent(PatentApplicationDO::getReviewMaterialsFiles, reqVO.getReviewMaterialsFiles())
                .eqIfPresent(PatentApplicationDO::getReturnFiles, reqVO.getReturnFiles())
                .orderByDesc(PatentApplicationDO::getId));
    }
    IPage<PatentApplicationNewRespVO> findPatentApplicationPage(Page<PatentApplicationNewRespVO> page,@Param("caseName")String caseName,@Param("reviewerBy")Long reviewerBy,@Param("userId")Long userId);

    PatentApplicationNewRespVO findPatentApplicationDetail(@Param("id")Long id);
}